-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(action_manager): Action Manager module integration #184
base: main
Are you sure you want to change the base?
Conversation
…mmunication and completes functions in photoshop js reference Signed-off-by: TsXor <[email protected]>
92899c8
to
4461d91
Compare
welp I've corrected using flake8, but I don't know what else linter hound is using... I did |
fe848d5
to
50c6ff3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
"pyflakes" failed during execution due to "'FlakesChecker' object has no attr...
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'" Run flake8 with greater verbosity to see more details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
"pyflakes" failed during execution due to "'FlakesChecker' object has no attr...
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'" Run flake8 with greater verbosity to see more details
ed6bb7e
to
c004a59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
"pyflakes" failed during execution due to "'FlakesChecker' object has no attr...
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'" Run flake8 with greater verbosity to see more details
c004a59
to
09680e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
"pyflakes" failed during execution due to "'FlakesChecker' object has no attr...
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'" Run flake8 with greater verbosity to see more details
09680e9
to
97d51a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
"pyflakes" failed during execution due to "'FlakesChecker' object has no attr...
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'" Run flake8 with greater verbosity to see more details
97d51a8
to
8fb9d18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
"pyflakes" failed during execution due to "'FlakesChecker' object has no attr...
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'" Run flake8 with greater verbosity to see more details
8fb9d18
to
f648c6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
"pyflakes" failed during execution due to "'FlakesChecker' object has no attr...
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'" Run flake8 with greater verbosity to see more details
f648c6b
to
f60b236
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
"pyflakes" failed during execution due to "'FlakesChecker' object has no attr...
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'" Run flake8 with greater verbosity to see more details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
"pyflakes" failed during execution due to "'FlakesChecker' object has no attr...
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'" Run flake8 with greater verbosity to see more details
5ecb5ab
to
405f8dd
Compare
d575363
to
3e35274
Compare
I may have to correct something about Action Manager and its classes: ActionDescriptor, ActionList, ActionReference. Action Manager is NOT something to describe your action palette. Action Manager actually enables low-level access into photoshop, and all things in this repo can actually be rewritten in Action Manager. You can consider an ActionDescriptor as dict, ActionList as array, ActionReference as filters for searching. So we should NOT set an INSTANCE of ActionDescriptor as an attribute of a Session and instead we should set the ActionDescriptor CLASS (the same for ActionList, ActionReference). Signed-off-by: TsXor <[email protected]>
desc_value_types and ref_form_types defines classes which describes AM things and utils contains a shortcut for id conversion. Nothing breaking. All AM functions are still available. My submodule uses relative importing because absolute importing causes bigger possibility in path typos. Signed-off-by: TsXor <[email protected]>
For example, I advice to do 'import photoshop.api.action_manager as am'. Then jprint(prefix='am') should be helpful. Signed-off-by: TsXor <[email protected]>
… use of my submodule In fact, why use those ****s born by ScriptListener Plug-in which is totally unreadable? Signed-off-by: TsXor <[email protected]>
Signed-off-by: TsXor <[email protected]>
change patching to (try eval + except), and now run black -l 80 to avoid hound warning There will be lots of violations in hound's eye which I cannot find out locally because hound's linter is not up to date. I will have to do some shattered commits, and for these commits, I will name them hop (hound oriented programming). Signed-off-by: TsXor <[email protected]>
… import picture example Signed-off-by: TsXor <[email protected]>
3e35274
to
04e9362
Compare
https://gist.github.com/TsXor/62a46f8f2846261bba7db1cc7ff02711 Just like Action Manager, I think a HowTo is more useful for this submodule. |
The import error is because the server used for importing does not have photoshop installed. This is fine for testing import. This module doesn't actaully need to do com binding on import because all these classes that inherited Photoshop in _core.py is only defined but not initialized before users of this module do anything. However, utils.py in my submodule breaks this because it initializes a ps.Application instance on importing for typeid conversion. This will not cause error on real situations, but will make it fail the import test. This can be tackled by not initializing an app on import and trigger the initialization when any of these functions that need an app is executed. |
…ded instead of do it on import to pass import test. 2. Warns user when typeID collision happens. (And id2str will try to avoid giving user string that will cause collision.) typeID collision happens when a stringID and a charID share the same name. For example, charID 'From' -> stringID 'from' and charID 'from' -> stringID 'originalAddressAttr', so 'from' is a string that will cause collision. After scanning the cpp header "PITerminology.h" and "PIStringTerminology.h", I found 3 such strings and hardcoded them into utils.py. str2id() will not automatically correct user when user gives a collision string (because no one knows what he want it to be a stringID or an charID!), but will regard that string as stringID and throw a warning. Users can follow that warning's guide to fix error and suppress that warning. Signed-off-by: TsXor <[email protected]>
53eeb27
to
2712d1c
Compare
You can get typeID collision detector at gist. |
Something more about charID: |
Signed-off-by: TsXor <[email protected]>
Signed-off-by: longhao <[email protected]>
Signed-off-by: TsXor <[email protected]>
232ea04
to
387387f
Compare
1a6ffd6
to
f77694b
Compare
Integrates https://github.com/TsXor/photoshop-ActionManager-python with minimum modification to main tree.
There's a problem: it seems that the generated code reference is not enough to document my submodule. So what should I do to add more document? By posting it in gist and attach a hyperlink?